%% set model parameters
T = 50; % number of age classes
age = 1:T; % vector of age classes
mature = 1*(age'>=7); % min age at maturity = 7

Linf = 360.3; % Terminal Length (in cm)
delta = 0.083; % von-Bertalanffy growth slope
mu = 0.942; % von-Bertalanffy growth intercept
L_a = Linf*(1-exp(-delta*(age+mu))); % Length: von-Bertalanffy growth (by age)

% Allometric biomass conversion 
omega = 2.8684E-5; % allometric weight proportionality
eta = 2.9076; % allometric weight exponent
w_a = omega*L_a.^eta; % weight in kg (length dependent)

% Natural morality 
m_a = zeros(T,1); % initialize
m_a(1:10)=[.49; .41; .32; .26; .22; .19; .17; .15; .13; .12];
m_a(11:20)=.11;
m_a(21:end)=.1;

sum_m = zeros(T,1); % sum of morality from age 1:a
for a = 1:T
    sum_m(a) = (age <= a)*m_a;
end
